{template 'header'}
<style type='text/css'>
.sel {
    background: #48b54e;
    color: #fff;
}

.nosel {
    background: #fff;
    color: #000
}
a{
    text-decoration: none;
}
</style>
<link rel="stylesheet" type="text/css" href="{MODULE_URL}template/mobile/style/style1/static/css/css.css" />
<div class="head" >
    <a onClick="window.location.href='{php echo $this->createMobileUrl('member')}'" class="bn pull-left"><i class="fa fa-angle-left"></i></a>
    <span class="title">我的订单</span>
    <a href="{php echo $this->createMobileUrl('shopping',array('op' => 'mycart'))}" class="bn pull-right"><i class="fa fa-shopping-cart"></i></a>
</div>
<div class="myoder img-rounded" style='text-align:center;color:#ddd;padding:5px;'>
    <div style='float:left;height:23px;margin:auto;width:60%;'>
        <div {if $status==0}class='sel' {else}class="nosel" {/if} style='border-top-left-radius: 5px;border-bottom-left-radius:5px;border:1px solid #ddd;text-align: center;float:left;width:30%' onclick="location.href='{php echo $this->createMobileUrl('shopping',array('op' => 'myorder','status'=>0))}'">
            待支付
        </div>
        <div {if $status==1 || $status==2}class='sel' {else}class="nosel" {/if} style='border:1px solid #ddd;margin-left:-1px;float:left;width:30%;text-align: center;' onclick="location.href='{php echo $this->createMobileUrl('shopping',array('op' => 'myorder','status'=>2))}'">
            待收货
        </div>
        <div {if $status==3}class='sel' {else}class="nosel" {/if} style='border-top-right-radius: 5px;margin-left:-1px;border-bottom-right-radius:5px;text-align: center;border:1px solid #ddd;float:left;width:30%' onclick="location.href='{php echo $this->createMobileUrl('shopping',array('op' => 'myorder','status'=>3))}'">
            已完成
        </div>
    </div>
</div>
{if count($list)<=0} <div class="myoder img-rounded" style='text-align:center;color:#aaa;padding:30px;'>
    您暂时没有任何订单!
    </div>
    {/if}
    <div style='margin-bottom:40px;'>
        {loop $list $item}
        <div class="myoder img-rounded">
            <div class="myoder-hd">
                <span class="pull-left">订单编号：{$item['ordersn']}</span>
                <span class="pull-right">{php echo date('Y-m-d H:i', $item['createtime'])}
		{if $item['paytype'] == 3}
			{if $item['status'] == -1}
			<span class="text-muted">订单取消</span> {elseif $item['status']
                < 3} <span class="text-danger">货到付款 / 未付款</span>
                    {else}
                    <span class="text-success">已完成</span> {/if} {else} {if $item['status'] == -1}
                    <span class="text-muted">订单取消</span> {elseif $item['status'] == 0}
                    <span class="text-danger">未付款</span> {elseif $item['status'] == 1}
                    <span class="text-warning">已付款</span> {elseif $item['status'] == 2}
                    <span class="text-warning">已发货</span> {else}
                    <span class="text-success">已完成</span> {/if} {/if}
                    </span>
            </div>
            {if count($item['goods'])==1} 
	            {loop $item['goods'] $goods}
	            <div class="myoder-detail">
	                <a href="{php echo $this->createMobileUrl('shopping', array('id' => $goods['id'],'op' => 'detail'))}">

	                    <img src="{php echo tomedia($goods['thumb']);}" alt="..." >
	                </a>
	                <div class="pull-left">
	                    <div class="name"><a href="{php echo $this->createMobileUrl('shopping', array('id' => $goods['id'],'op' => 'myorder','operation' => 'detail'))}">{$goods['title']}</a></div>
	                    <div class="price">
	                        <span class="pull-left">{$goods['marketprice']} 元{if $goods['unit']} / {$goods['unit']}{/if}</span>
	                        <span class="num pull-right">{$item['total'][$goods['id']]['total']}{if $goods['unit']} {$goods['unit']}{/if}</span>
	                    </div>
	                </div>
	            </div>
	            {/loop} 
            {else}
	            <div class="myoder-detail">
	                {loop $item['goods'] $goods}
	                <a href="{php echo $this->createMobileUrl('shopping', array('id' => $goods['id'],'op' => 'detail'))}">
	                    <img src="{php echo tomedia($goods['thumb']);}" width="160" />
	                </a>
	                {/loop}
	            </div>
            {/if}
            <div class="myoder-total">
                <span>
			共计：<span class="false">
				{if $item['dispatchprice']<=0}
					{$item['price']} 元
				{else}
					{$item['price']} 元 (运费 {$item['dispatchprice']} 元)
				{/if}</span>
                </span>
                <div style="height:30px;"><a href="{php echo $this->createMobileUrl('shopping', array('orderid' => $item['id'], 'operation' => 'detail','op' => 'myorder'))}" class="btn btn-success pull-right btn-sm">订单详情</a></div>
            </div>
        </div>
        {/loop}</div>
 {template 'style/style1/footer'}